#ifndef __SQLFTP_H__
#define __SQLFTP_H__
#include "ftp.h"
#define SQLHOST "localhost"
#define SQLUSER "root"
#define SQLPWD "kl"
#define SQLDB "ftpsql"

typedef struct accountinfo {
    int uid;
    char username[LENNAM];
    char salt[20];
    char cpwd[99];
    char pwd[128]; 
}account_t, *pAccount_t;//已与数据库匹配

int sqlInit(MYSQL **ppMysql);

int sqlFindAccount(MYSQL *pMysql, const char *userName, pAccount_t pAccount, int flag);
int sqlAddAccount(MYSQL **ppMysql, account_t account);
void printAccount(account_t account);

int loginCheck(socket_t clifd, MYSQL *pMysql);
int doSignUp(socket_t clifd, MYSQL **ppMysql);
int loginOrSign(socket_t clifd, MYSQL **ppMysql);
#endif
